package cn.bigcontainer.alt.b2c.fe.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;

import cn.bigcontainer.alt.cms.dto.CmsNeirongDto;
import cn.bigcontainer.alt.cms.service.CmsNeirongService;
import cn.bigcontainer.alt.sys.util.SysConstant;

@Controller
@SessionAttributes(SysConstant.SESSION_USER)
public class HomeController {
	
	@Resource
	private CmsNeirongService cmsNeirongService;
	
	/**
	 * @return
	 */
	@RequestMapping("/")
	public String toHome (Map<String, Object> map) {
		List<CmsNeirongDto> nrs = cmsNeirongService.getNeirongChildren("000");
		List<CmsNeirongDto> tuijian = cmsNeirongService.getNeirongChildren("010");
		List<CmsNeirongDto> spfl = cmsNeirongService.getNeirongChildren("020");
		map.put("lunbotu", nrs);
		map.put("tuijian",tuijian);
		map.put("spfl",spfl);
		return "index";
	}
}
